﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Lilium.Web.Mvc.MicrosoftAjax
{
	internal sealed class MicrosoftAjaxCultureInfoResource: ScriptResource
	{
		public MicrosoftAjaxCultureInfoResource(string name, string contentType, OutputCachePolicy cachePolicy)
			: base(name, contentType, cachePolicy)
		{
		}

		protected override void OnProcessRequest(ControllerContext context)
		{
			if (context == null)
				throw new ArgumentNullException("context");

			var response = context.HttpContext.Response;
			response.ContentEncoding = Encoding.UTF8;
			response.Write(ClientCultureInfo.GetClientCultureScriptBlock());
		}
	}
}
